<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>忘记密码 | 代码狂想</title>
    <style>
        /* 基础样式与野蛮主义风格 */
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Arial', sans-serif;
            line-height: 1.6;
            background-color: #f0f0f0;
            color: #222;
            padding: 20px;
            max-width: 1200px;
            margin: 0 auto;
            min-height: 100vh;
            display: flex;
            flex-direction: column;
        }

        /* 野蛮主义风格特点：粗体、不对称、高对比度 */
        header {
            background-color: #000;
            color: #fff;
            padding: 30px;
            margin-bottom: 30px;
            border: 5px solid #ff0066;
            position: relative;
        }

        h1 {
            font-size: 4rem;
            font-weight: 900;
            text-transform: uppercase;
            letter-spacing: -2px;
            line-height: 1;
        }

        .tagline {
            font-size: 1.5rem;
            margin-top: 10px;
            color: #ff0066;
        }

        /* 导航样式 - 保持原始链接外观但放大 */
        nav {
            background-color: #ff0066;
            padding: 15px;
            margin-bottom: 30px;
        }

        nav ul {
            list-style: none;
            display: flex;
            flex-wrap: wrap;
        }

        nav li {
            margin-right: 30px;
        }

        nav a {
            color: #000;
            text-decoration: none;
            font-weight: bold;
            font-size: 1.2rem;
            padding: 5px 10px;
            background-color: #fff;
        }

        nav a:hover {
            background-color: #000;
            color: #fff;
        }

        /* 忘记密码容器 */
        .forgot-container {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 30px;
            margin-bottom: 30px;
            flex: 1;
        }

        /* 忘记密码表单样式 */
        .forgot-form {
            background-color: #fff;
            padding: 30px;
            border: 3px solid #000;
            box-shadow: 8px 8px 0 #000;
        }

        .forgot-form h2 {
            font-size: 2.5rem;
            margin-bottom: 20px;
            color: #ff0066;
            border-bottom: 2px solid #000;
            padding-bottom: 10px;
        }

        .form-group {
            margin-bottom: 20px;
        }

        .form-group label {
            display: block;
            margin-bottom: 5px;
            font-weight: bold;
            font-size: 1.1rem;
        }

        .form-group input {
            width: 100%;
            padding: 12px;
            border: 2px solid #000;
            font-family: inherit;
            font-size: 1rem;
        }

        .form-group input:focus {
            outline: none;
            border-color: #ff0066;
            box-shadow: 0 0 0 2px rgba(255, 0, 102, 0.3);
        }

        .error-message {
            color: #ff0066;
            font-size: 0.9rem;
            margin-top: 5px;
            display: none;
        }

        .success-message {
            color: #00cc66;
            font-size: 0.9rem;
            margin-top: 5px;
            display: none;
        }

        .reset-btn {
            background-color: #000;
            color: #fff;
            padding: 12px 20px;
            border: none;
            font-weight: bold;
            font-size: 1.1rem;
            cursor: pointer;
            width: 100%;
            margin-top: 10px;
        }

        .reset-btn:hover {
            background-color: #ff0066;
        }

        .form-footer {
            margin-top: 20px;
            text-align: center;
        }

        .form-footer a {
            color: #ff0066;
            text-decoration: none;
            font-weight: bold;
        }

        .form-footer a:hover {
            text-decoration: underline;
        }

        /* 信息区域 */
        .forgot-info {
            background-color: #000;
            color: #fff;
            padding: 30px;
            border: 3px solid #ff0066;
        }

        .forgot-info h3 {
            font-size: 1.8rem;
            margin-bottom: 20px;
            color: #ff0066;
        }

        .forgot-info ul {
            margin-left: 20px;
            margin-bottom: 20px;
        }

        .forgot-info li {
            margin-bottom: 10px;
        }

        .step-list {
            margin-top: 30px;
        }

        .step-item {
            display: flex;
            align-items: center;
            margin-bottom: 15px;
        }

        .step-icon {
            background-color: #ff0066;
            color: #000;
            width: 30px;
            height: 30px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            margin-right: 10px;
            font-weight: bold;
        }

        /* 野蛮主义风格的特色元素 */
        .brutal-element {
            height: 10px;
            background-color: #ff0066;
            margin: 20px 0;
        }

        footer {
            background-color: #000;
            color: #fff;
            padding: 30px;
            text-align: center;
            margin-top: 30px;
            border-top: 5px solid #ff0066;
        }

        /* 响应式设计 */
        @media (max-width: 768px) {
            .forgot-container {
                grid-template-columns: 1fr;
            }

            h1 {
                font-size: 2.5rem;
            }

            nav ul {
                flex-direction: column;
            }

            nav li {
                margin-bottom: 10px;
            }
        }
    </style>
</head>

<body>
    <header>
        <h1>代码狂想</h1>
        <p class="tagline">原始 · 直接 · 不妥协的技术思考</p>
    </header>

    <nav>
        <ul>
            <li><a href="index.html">首页</a></li>
            <li><a href="#">前端开发</a></li>
            <li><a href="#">后端架构</a></li>
            <li><a href="#">算法与数据结构</a></li>
            <li><a href="#">设计模式</a></li>
            <li><a href="about.html">关于</a></li>
            <li><a href="login.html">登录</a></li>
            <li><a href="register.html">注册</a></li>
        </ul>
    </nav>

    <div class="forgot-container">
        <div class="forgot-form">
            <h2>重置密码</h2>
            <form id="forgotForm">
                <div class="form-group">
                    <label for="email">电子邮箱</label>
                    <input type="email" id="email" name="email" placeholder="请输入您注册时使用的电子邮箱" required>
                    <div class="error-message" id="emailError">请输入有效的电子邮箱地址</div>
                    <div class="success-message" id="emailSuccess">密码重置链接已发送到您的邮箱</div>
                </div>

                <button type="submit" class="reset-btn">发送重置链接</button>

                <div class="form-footer">
                    <p>记起密码了？<a href="login.html">返回登录</a></p>
                </div>
            </form>
        </div>

        <div class="forgot-info">
            <h3>密码重置流程</h3>
            <p>按照以下步骤重置您的账户密码：</p>

            <div class="step-list">
                <div class="step-item">
                    <div class="step-icon">1</div>
                    <span>输入您注册时使用的电子邮箱</span>
                </div>
                <div class="step-item">
                    <div class="step-icon">2</div>
                    <span>检查您的邮箱，点击密码重置链接</span>
                </div>
                <div class="step-item">
                    <div class="step-icon">3</div>
                    <span>创建新的密码并确认</span>
                </div>
                <div class="step-item">
                    <div class="step-icon">4</div>
                    <span>使用新密码登录您的账户</span>
                </div>
            </div>

            <div class="brutal-element"></div>

            <h3>安全提示</h3>
            <ul>
                <li>密码重置链接将在24小时后失效</li>
                <li>请勿与他人分享您的密码重置链接</li>
                <li>如果您未请求重置密码，请忽略此邮件</li>
                <li>建议定期更换密码以增强账户安全</li>
            </ul>

            <div class="brutal-element"></div>

            <h3>遇到问题？</h3>
            <p>如果您在重置密码过程中遇到任何问题，请联系我们的支持团队：</p>
            <p>邮箱: support@codecraze.blog</p>
            <p>我们将在24小时内回复您的请求。</p>
        </div>
    </div>

    <footer>
        <p>代码狂想 &copy; 2023 · 遵循野蛮主义设计原则构建</p>
        <p>联系方式: contact@codecraze.blog</p>
    </footer>

    <script>
        // 表单验证逻辑
        document.getElementById('forgotForm').addEventListener('submit', function (e) {
            e.preventDefault();

            let isValid = true;
            const email = document.getElementById('email').value.trim();

            // 验证邮箱
            const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
            if (!emailRegex.test(email)) {
                document.getElementById('emailError').style.display = 'block';
                document.getElementById('emailSuccess').style.display = 'none';
                isValid = false;
            } else {
                document.getElementById('emailError').style.display = 'none';

                // 模拟发送重置链接成功
                document.getElementById('emailSuccess').style.display = 'block';

                // 实际应用中这里应该发送AJAX请求到服务器
                // 这里使用setTimeout模拟异步操作
                setTimeout(function () {
                    alert('密码重置链接已发送到您的邮箱，请检查您的收件箱（包括垃圾邮件文件夹）。');
                    // 实际应用中可以重定向到确认页面
                    window.location.href = 'reset-sent.html';
                }, 500);
            }
        });

        // 实时验证输入
        document.getElementById('email').addEventListener('input', function () {
            const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
            if (emailRegex.test(this.value.trim())) {
                document.getElementById('emailError').style.display = 'none';
                document.getElementById('emailSuccess').style.display = 'none';
            }
        });
    </script>
</body>

</html>